{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/containers/Contacts.tsx\",\n  _s = $RefreshSig$();\nimport React from \"react\";\nimport { Contacts as ContactsList } from \"../components/\";\nimport { Context } from \"../index\";\nimport { observer } from \"mobx-react-lite\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst Contacts = () => {\n  _s();\n  const {\n    store\n  } = React.useContext(Context);\n  const [contacts, setContacts] = React.useState({\n    items: []\n  });\n  const [flag, setFlag] = React.useState(false);\n  React.useEffect(() => {\n    if (!flag && store.getChats().items === undefined) {\n      store.getChatsFromAPI().then();\n    } else {\n      setFlag(true);\n    }\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, []);\n  return /*#__PURE__*/_jsxDEV(ContactsList, {\n    contacts: contacts,\n    currentUser: store.getProfile()\n  }, void 0, false, {\n    fileName: _jsxFileName,\n    lineNumber: 22,\n    columnNumber: 9\n  }, this);\n};\n_s(Contacts, \"HL/hwKq2pw/yhOYlTHpge1RLJo4=\");\n_c = Contacts;\nexport default _c2 = observer(Contacts);\nvar _c, _c2;\n$RefreshReg$(_c, \"Contacts\");\n$RefreshReg$(_c2, \"%default%\");","map":{"version":3,"names":["React","Contacts","ContactsList","Context","observer","store","useContext","contacts","setContacts","useState","items","flag","setFlag","useEffect","getChats","undefined","getChatsFromAPI","then","getProfile"],"sources":["/data/messenger.client/src/containers/Contacts.tsx"],"sourcesContent":["import React from \"react\";\nimport {Contacts as ContactsList} from \"../components/\";\nimport {Context} from \"../index\";\nimport {observer} from \"mobx-react-lite\";\nimport {ContactListResponse} from \"../models/response/ContactListResponse\";\n\nconst Contacts:React.FC = () => {\n    const {store} = React.useContext(Context);\n    const [contacts, setContacts] = React.useState<ContactListResponse>({items: []});\n    const [flag, setFlag] = React.useState<boolean>(false);\n\n    React.useEffect(() => {\n        if (!flag && store.getChats().items === undefined) {\n            store.getChatsFromAPI().then();\n        } else {\n            setFlag(true);\n        }\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, []);\n\n    return (\n        <ContactsList\n            contacts={contacts}\n            currentUser={store.getProfile()}\n        />\n    );\n\n};\n\nexport default observer(Contacts);"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,QAAQ,IAAIC,YAAY,QAAO,gBAAgB;AACvD,SAAQC,OAAO,QAAO,UAAU;AAChC,SAAQC,QAAQ,QAAO,iBAAiB;AAAC;AAGzC,MAAMH,QAAiB,GAAG,MAAM;EAAA;EAC5B,MAAM;IAACI;EAAK,CAAC,GAAGL,KAAK,CAACM,UAAU,CAACH,OAAO,CAAC;EACzC,MAAM,CAACI,QAAQ,EAAEC,WAAW,CAAC,GAAGR,KAAK,CAACS,QAAQ,CAAsB;IAACC,KAAK,EAAE;EAAE,CAAC,CAAC;EAChF,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGZ,KAAK,CAACS,QAAQ,CAAU,KAAK,CAAC;EAEtDT,KAAK,CAACa,SAAS,CAAC,MAAM;IAClB,IAAI,CAACF,IAAI,IAAIN,KAAK,CAACS,QAAQ,EAAE,CAACJ,KAAK,KAAKK,SAAS,EAAE;MAC/CV,KAAK,CAACW,eAAe,EAAE,CAACC,IAAI,EAAE;IAClC,CAAC,MAAM;MACHL,OAAO,CAAC,IAAI,CAAC;IACjB;IACA;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,oBACI,QAAC,YAAY;IACT,QAAQ,EAAEL,QAAS;IACnB,WAAW,EAAEF,KAAK,CAACa,UAAU;EAAG;IAAA;IAAA;IAAA;EAAA,QAClC;AAGV,CAAC;AAAC,GArBIjB,QAAiB;AAAA,KAAjBA,QAAiB;AAuBvB,qBAAeG,QAAQ,CAACH,QAAQ,CAAC;AAAC;AAAA;AAAA"},"metadata":{},"sourceType":"module"}